package com.edu.exam.enums.grading;

import com.edu.exam.enums.core.BaseEnum;

/**
 * 导出数据类型枚举
 */
public enum ExportDataType implements BaseEnum {
    GRADE("GRADE", "成绩数据"),
    STUDENT("STUDENT", "学生数据"),
    COURSE("COURSE", "课程数据"),
    CLASS("CLASS", "班级数据"),
    ANALYSIS("ANALYSIS", "分析数据"),
    SUMMARY("SUMMARY", "汇总数据"),
    STATISTICS("STATISTICS", "统计数据"),
    REPORT("REPORT", "报表数据"),
    ATTENDANCE("ATTENDANCE", "考勤数据"),
    EVALUATION("EVALUATION", "评价数据");

    private final String code;
    private final String description;

    ExportDataType(String code, String description) {
        this.code = code;
        this.description = description;
    }

    @Override
    public String getCode() {
        return code;
    }

    @Override
    public String getDescription() {
        return description;
    }

    public static ExportDataType fromCode(String code) {
        for (ExportDataType type : values()) {
            if (type.getCode().equals(code)) {
                return type;
            }
        }
        return GRADE; // 默认返回成绩数据
    }
}